﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="AsyncFileUploadSimple.ascx.cs" Inherits="AsyncFileUploadSimple" %>

<script type = "text/javascript">
    function uploadComplete(sender) {
        $get("<%=lblMesg.ClientID%>").innerHTML = "File Uploaded Successfully";
        $get("<%=lblMesg.ClientID%>").style.color = "green";
    }

    function uploadError(sender) {
        $get("<%=lblMesg.ClientID%>").innerHTML = "File upload failed.";
        $get("<%=lblMesg.ClientID%>").style.color = "red";
    }
</script>
<img id="imgUpload" src="../content/images/default-image.gif" alt="" height="100" width="100" />
</br>
<ajaxToolkit:AsyncFileUpload OnClientUploadError="uploadError" OnClientUploadComplete="uploadComplete" runat="server"
        ID="AsyncFileUpload1" Width="400px" UploaderStyle="Traditional" CompleteBackColor = "White" UploadingBackColor="#CCFFFF"  
        ThrobberID="imgLoader" OnUploadedComplete = "AsyncFileUploadComplete" />
<asp:Image ID="imgLoader" runat="server" ImageUrl = "~/images/uploading.gif" />
<asp:Label ID="lblMesg" runat="server" Text=""></asp:Label>    

